<?php

include ("conexao.php");
include ("interfaces/IDao.php");

class ClienteDao implements IDao {

    public $con;
    private $conexao;

    public function __construct() {
        try {
            $this->con = new conexao();
            $this->conexao = $this->con->getConnection();
        } catch (PDOException $exc) {
            echo $exc->getTraceAsString();
        }
    }

    public function add($cliente) {
        
        
        
    }

    public function delete($cliente) {
        
    }

    public function edit($cliente) {
        
    }

    public function select($cliente) {
        try {

//prepara a query e executa. 
            $rs = $this->conexao->prepare("SELECT * FROM produto");
            // $rs->bindParam(1, $cliente->getId());
            $rs->execute();
// retorna o resultset. 

            return $rs;
        } catch (PDOException $exc) {
            echo $exc->getTraceAsString();
        }
    }

}

?>
